package com.jungle.bfi.service.biz.impl;

import com.github.dozermapper.core.Mapper;
import com.jungle.base.domain.bo.BaseUserBo;
import com.jungle.base.service.AbstractService;
import com.jungle.bfi.domain.bo.AuxiliaryItemBo;
import com.jungle.bfi.entity.AuxiliaryItemPo;
import com.jungle.bfi.service.biz.AuxiliaryItemService;
import jakarta.annotation.Resource;
import org.n3r.idworker.Sid;

public class AuxiliaryItemServiceImpl extends AbstractService<AuxiliaryItemPo, AuxiliaryItemBo, String> implements AuxiliaryItemService {
    @Resource
    private Mapper mapper;
    @Override
    protected String getBoId(AuxiliaryItemBo bo) {
        return bo.getId();
    }

    @Override
    protected String newPoId() {
        return Sid.nextShort();
    }

    @Override
    protected void updatePo(AuxiliaryItemBo bo, BaseUserBo userBo, AuxiliaryItemPo po) {
        mapper.map(bo, po);
    }

    @Override
    protected AuxiliaryItemPo createPo(AuxiliaryItemBo bo, BaseUserBo userBo) {
        return mapper.map(bo, AuxiliaryItemPo.class);
    }
}
